import request from '@/utils/request'

export function getGoodsList(params) {
  return request({
    url: '/manager/commodity/list',
    method: 'post',
    data: params
  })
}

export function getGoodDetail(id) {
  return request({
    url: '/manager/commodity/detail',
    method: 'post',
    data: { id }
  })
}
// 定义的接口方法
export function upload(params) {
  console.log('请求数据', params)
  return request({
    url: '/tools/oss/upload',
    method: 'post',
    data: params
  })
}

export function operateGood(params) {
  return request({
    url: '/manager/commodity/operate',
    method: 'post',
    data: params
  })
}

export function createGood(params) {
  return request({
    url: '/manager/commodity/create',
    method: 'post',
    data: params
  })
}

export function modifyGood(params) {
  return request({
    url: '/manager/commodity/modify',
    method: 'post',
    data: params
  })
}

export function getProfessorList() {
  return request({
    url: '/manager/commodity/queryAllProfessor',
    method: 'post'
  })
}
